<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateAddressesTable extends Migration
{
    public function up()
    {
        Schema::create('addresses', function (Blueprint $table) {
            $table->id();
	        $table->unsignedBigInteger('user_id')->default(0)->index();
	        $table->string('id_code')->nullable();
	        $table->string('id_name')->nullable();
	        $table->string('contact_name');
	        $table->string('contact_phone');
	        $table->string('province');
	        $table->string('city');
	        $table->string('district');
	        $table->string('province_code');
	        $table->string('city_code');
	        $table->string('district_code');
	        $table->string('address');
	        $table->boolean('is_default')->default(false);
            $table->timestamps();
        });
    }

    public function down()
    {
        Schema::dropIfExists('addresses');
    }
}
